package com.ry.est.service.impl;

import com.ry.est.constants.Constants;
import com.ry.est.dao.AppointmentDao;
import com.ry.est.entity.Appointment;
import com.ry.est.service.AppointmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * @author ry
 * @since 2021-11-10 09:28
 **/
@Service
public class AppointmentServiceImpl implements AppointmentService {
    @Autowired
    private AppointmentDao appointmentDao;

    @Override
    public int addAppointment(Appointment appointment) {
        appointment.setCreatedTime(new Date());
        appointment.setIsDelete(Constants.EST_NOT);
        return appointmentDao.insert(appointment);
    }
}
